package com.cloud.force.api.entity;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonFormat;

@Table(name = "rec_force_measure")
public class RecForceMeasure {
    @Id
    @Column(name = "rec_id")
    private Long recId;

    @Column(name = "measure_type_id")
    private String measureTypeId;

    @Column(name = "measure_type_name")
    private String measureTypeName;

    @Column(name = "measure_detail")
    private String measureDetail;

    @Column(name = "approval_date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date approvalDate;

    @Column(name = "approval_doc_num")
    private String approvalDocNum;

    @Column(name = "received_date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date receivedDate;

    @Column(name = "received_type_id")
    private String receivedTypeId;

    @Column(name = "received_type_name")
    private String receivedTypeName;

    @Column(name = "measure_begin")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date measureBegin;

    @Column(name = "measure_end")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date measureEnd;

    @Column(name = "execute_date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date executeDate;

    @Column(name = "delay_flag")
    private Integer delayFlag;

    @Column(name = "delay_end")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date delayEnd;

    @Column(name = "hand_type_id")
    private String handTypeId;

    @Column(name = "hand_type_name")
    private String handTypeName;

    @Column(name = "decide_doc_id")
    private String decideDocId;

    @Column(name = "decide_doc_name")
    private String decideDocName;

    @Column(name = "force_result")
    private String forceResult;

    @Column(name = "uuid")
    private String uuid;
    /**
     * URL
     */
    @Transient
    private List<Map<String,Object>> decideDocUrl;

    public List<Map<String, Object>> getDecideDocUrl() {
        return decideDocUrl;
    }

    public void setDecideDocUrl(List<Map<String, Object>> decideDocUrl) {
        this.decideDocUrl = decideDocUrl;
    }

    /**
     * @return rec_id
     */
    public Long getRecId() {
        return recId;
    }

    /**
     * @param recId
     */
    public void setRecId(Long recId) {
        this.recId = recId;
    }

    /**
     * @return measure_type_id
     */
    public String getMeasureTypeId() {
        return measureTypeId;
    }

    /**
     * @param measureTypeId
     */
    public void setMeasureTypeId(String measureTypeId) {
        this.measureTypeId = measureTypeId;
    }

    /**
     * @return measure_type_name
     */
    public String getMeasureTypeName() {
        return measureTypeName;
    }

    /**
     * @param measureTypeName
     */
    public void setMeasureTypeName(String measureTypeName) {
        this.measureTypeName = measureTypeName;
    }

    /**
     * @return measure_detail
     */
    public String getMeasureDetail() {
        return measureDetail;
    }

    /**
     * @param measureDetail
     */
    public void setMeasureDetail(String measureDetail) {
        this.measureDetail = measureDetail;
    }

    /**
     * @return approval_date
     */
    public Date getApprovalDate() {
        return approvalDate;
    }

    /**
     * @param approvalDate
     */
    public void setApprovalDate(Date approvalDate) {
        this.approvalDate = approvalDate;
    }

    /**
     * @return approval_doc_num
     */
    public String getApprovalDocNum() {
        return approvalDocNum;
    }

    /**
     * @param approvalDocNum
     */
    public void setApprovalDocNum(String approvalDocNum) {
        this.approvalDocNum = approvalDocNum;
    }

    /**
     * @return received_date
     */
    public Date getReceivedDate() {
        return receivedDate;
    }

    /**
     * @param receivedDate
     */
    public void setReceivedDate(Date receivedDate) {
        this.receivedDate = receivedDate;
    }

    /**
     * @return received_type_id
     */
    public String getReceivedTypeId() {
        return receivedTypeId;
    }

    /**
     * @param receivedTypeId
     */
    public void setReceivedTypeId(String receivedTypeId) {
        this.receivedTypeId = receivedTypeId;
    }

    /**
     * @return received_type_name
     */
    public String getReceivedTypeName() {
        return receivedTypeName;
    }

    /**
     * @param receivedTypeName
     */
    public void setReceivedTypeName(String receivedTypeName) {
        this.receivedTypeName = receivedTypeName;
    }

    /**
     * @return measure_begin
     */
    public Date getMeasureBegin() {
        return measureBegin;
    }

    /**
     * @param measureBegin
     */
    public void setMeasureBegin(Date measureBegin) {
        this.measureBegin = measureBegin;
    }

    /**
     * @return measure_end
     */
    public Date getMeasureEnd() {
        return measureEnd;
    }

    /**
     * @param measureEnd
     */
    public void setMeasureEnd(Date measureEnd) {
        this.measureEnd = measureEnd;
    }

    /**
     * @return execute_date
     */
    public Date getExecuteDate() {
        return executeDate;
    }

    /**
     * @param executeDate
     */
    public void setExecuteDate(Date executeDate) {
        this.executeDate = executeDate;
    }

    /**
     * @return delay_flag
     */
    public Integer getDelayFlag() {
        return delayFlag;
    }

    /**
     * @param delayFlag
     */
    public void setDelayFlag(Integer delayFlag) {
        this.delayFlag = delayFlag;
    }

    /**
     * @return delay_end
     */
    public Date getDelayEnd() {
        return delayEnd;
    }

    /**
     * @param delayEnd
     */
    public void setDelayEnd(Date delayEnd) {
        this.delayEnd = delayEnd;
    }

    /**
     * @return hand_type_id
     */
    public String getHandTypeId() {
        return handTypeId;
    }

    /**
     * @param handTypeId
     */
    public void setHandTypeId(String handTypeId) {
        this.handTypeId = handTypeId;
    }

    /**
     * @return hand_type_name
     */
    public String getHandTypeName() {
        return handTypeName;
    }

    /**
     * @param handTypeName
     */
    public void setHandTypeName(String handTypeName) {
        this.handTypeName = handTypeName;
    }

    /**
     * @return decide_doc_id
     */
    public String getDecideDocId() {
        return decideDocId;
    }

    /**
     * @param decideDocId
     */
    public void setDecideDocId(String decideDocId) {
        this.decideDocId = decideDocId;
    }

    /**
     * @return decide_doc_name
     */
    public String getDecideDocName() {
        return decideDocName;
    }

    /**
     * @param decideDocName
     */
    public void setDecideDocName(String decideDocName) {
        this.decideDocName = decideDocName;
    }

    /**
     * @return force_result
     */
    public String getForceResult() {
        return forceResult;
    }

    /**
     * @param forceResult
     */
    public void setForceResult(String forceResult) {
        this.forceResult = forceResult;
    }

    public String getUuid() {return uuid;}

    public void setUuid(String uuid) {
        if(uuid==null){
            this.uuid = UUID.randomUUID().toString().replace("-", "");
        }else {
            this.uuid = uuid;
        }
    }
}